# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CertificateManager.V1.Model.CertificateMapEntry do
  @moduledoc """
  Defines a certificate map entry.

  ## Attributes

  *   `certificates` (*type:* `list(String.t)`, *default:* `nil`) - Optional. A set of Certificates defines for the given `hostname`. There can be defined up to four certificates in each Certificate Map Entry. Each certificate must match pattern `projects/*/locations/*/certificates/*`.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The creation timestamp of a Certificate Map Entry.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. One or more paragraphs of text description of a certificate map entry.
  *   `hostname` (*type:* `String.t`, *default:* `nil`) - A Hostname (FQDN, e.g. `example.com`) or a wildcard hostname expression (`*.example.com`) for a set of hostnames with common suffix. Used as Server Name Indication (SNI) for selecting a proper certificate.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. Set of labels associated with a Certificate Map Entry.
  *   `matcher` (*type:* `String.t`, *default:* `nil`) - A predefined matcher for particular cases, other than SNI selection.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. A user-defined name of the Certificate Map Entry. Certificate Map Entry names must be unique globally and match pattern `projects/*/locations/*/certificateMaps/*/certificateMapEntries/*`.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. A serving state of this Certificate Map Entry.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The update timestamp of a Certificate Map Entry.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :certificates => list(String.t()) | nil,
          :createTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :hostname => String.t() | nil,
          :labels => map() | nil,
          :matcher => String.t() | nil,
          :name => String.t() | nil,
          :state => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:certificates, type: :list)
  field(:createTime, as: DateTime)
  field(:description)
  field(:hostname)
  field(:labels, type: :map)
  field(:matcher)
  field(:name)
  field(:state)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.CertificateManager.V1.Model.CertificateMapEntry do
  def decode(value, options) do
    GoogleApi.CertificateManager.V1.Model.CertificateMapEntry.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CertificateManager.V1.Model.CertificateMapEntry do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
